home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Cream of the Crop 26
/
Cream of the Crop 26.iso
/
os2
/
octa209s.zip
/
octave-2.09
/
libcruft
/
odepack
/
vnorm.f
< prev
next >
Wrap
Text File
|
1996-07-19
|
726b
|
19 lines
DOUBLE PRECISION FUNCTION VNORM (N, V, W)
CLLL. OPTIMIZE
C-----------------------------------------------------------------------
C THIS FUNCTION ROUTINE COMPUTES THE WEIGHTED ROOT-MEAN-SQUARE NORM
C OF THE VECTOR OF LENGTH N CONTAINED IN THE ARRAY V, WITH WEIGHTS
C CONTAINED IN THE ARRAY W OF LENGTH N..
C VNORM = SQRT( (1/N) * SUM( V(I)*W(I) )**2 )
C-----------------------------------------------------------------------
INTEGER N, I
DOUBLE PRECISION V, W, SUM
DIMENSION V(N), W(N)
SUM = 0.0D0
DO 10 I = 1,N
10 SUM = SUM + (V(I)*W(I))**2
VNORM = DSQRT(SUM/DBLE(N))
RETURN
C----------------------- END OF FUNCTION VNORM -------------------------
END